﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PefStudio.Windows
{
    [Export(MainWindow.MainStatusBarContract, typeof(IStatusBarItem))]
    public sealed class ProgressBar : ToolStripProgressBar, IStatusBarItem
    {
        public ProgressBar()
        {
            Visible = true;
        }

        public string ID
        {
            get { return "ProgressBar"; }
        }

        public double Index
        {
            get { return 0.0; }
        }

        public string InsertRelativeToID
        {
            get { return "MessageLabel"; }
        }

        public bool BeforeRelativeID
        {
            get { return false; }
        }

        public bool HasSeparator
        {
            get { return false; }
        }

        public void SetProgress(int value)
        {
            Action setProgressAction = delegate
            {
                Value = value;
            };
            setProgressAction();
        }
    }
}
